<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var obj = {
            name: '毛朔',
            age: 19,
            sex: '男',
            fn: function () { }
        }

        // 遍历
        for (var k in obj) {
            console.log(k);//k 变量 输出 得到属性名
            console.log(obj[k]);//obj[k] 得到属性值
        }
    </script>
</head>

<body>

</body>

</html>